//这么复杂判断两个是，判断never和any
export type IsEqual<T, U, Success, Fail> = [T] extends [U]
  ? [U] extends [T]
    ? keyof T extends keyof U
      ? keyof U extends keyof T//isAny
        ? Success
        : Fail
      : Fail
    : Fail
  : Fail;

  export type FindIndex<T extends any[], U, F extends any[] = []> = T extends [
  infer L,
  ...infer R
]
  ? IsEqual<L, U, [...F]["length"], FindIndex<R, U, [...F, L]>>
  : //   ? [L] extends [U]//这个注释是上行实现的大题逻辑
    //     ? [...F]["length"]
    //     : FindIndex<R, U, [...F, L]>
    never;
type a1 = [any, never, 1, "2", true];
// type a1 = [7, 6, 1, "2", true];
type a2 = FindIndex<a1, 1>; // 2
type a3 = FindIndex<a1, 3>; // never
type a31 = FindIndex<a1, never>; // 1
type a32 = FindIndex<a1, any>; // 0
type a4 = FindIndex<[1, 6, "g", 8, 2], 8>;//3

type aa = 1 extends 4 ? 33 : 44;
type aa1 = 1 extends 1 ? 33 : 44;

export {};
